FROM node:16-buster-slim as builder

RUN npm config get registry \
    && echo 'sass_binary_site=https://npm.taobao.org/mirrors/node-sass/' >> ~/.npmrc \
    &&  npm config set registry https://registry.npm.taobao.org \
    && npm config get registry

WORKDIR /app

COPY . .
RUN npm install
RUN npm run build:prod

FROM nginx:alpine
COPY --from=builder /app/dist  /usr/share/nginx/html/dist
